﻿using System.Collections.Generic;
using System.ServiceModel;

namespace RG.Common
{
    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IGetPutService<T>
    {
        [OperationContract]
        T Get(int id);
        [OperationContract]
        T Put(T item);
    }

    public interface IParam
    {
        List<int> Ids { get;set; }
    }

    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IListService<T, TParam>
        where TParam : IParam
    {
        [OperationContract]
        List<T> List(TParam param);
    }

    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IPrepareListService<T, TParam> : IListService<T, TParam>
        where TParam : IParam
    {
        [OperationContract]
        List<int> ListPrepare(TParam param);
    }


    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IService<T, TParam> : IGetPutService<T>, IListService<T, TParam>
        where TParam : IParam
    {
    }

    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IHugeDataService<T, TParam> : IGetPutService<T>, IPrepareListService<T, TParam>
        where TParam : IParam
    {
    }

    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    public interface IChangeState<T>
    {
        [OperationContract]
        T ChangeState(int id, int oldState, int newState, string comment);
    }


}